<template>
  <div>
    <supertable :tableData="tableData" :headerData="headerData" :isoperation="false" :ispagination="false">
      <!-- 操作 -->
      <template v-slot:isoperation="row">
        <div @click="isoperationFn(row.row)">
          <el-row>
            <el-button type="primary" icon="el-icon-edit" circle></el-button>
          </el-row>
        </div>
      </template>
      <template v-slot:formSolt>
        <div>
          <el-button type="success" size="mini" icon="el-icon-search" @click="SpecificationFn()">添加
          </el-button>
        </div>
      </template>
    </supertable>
  </div>
</template>
<script>
import supertable from "@/components/supertable";
import { MenuManagementInterface } from "@/api/SystemManagement";
import { item } from "copy-concurrently";
export default {
  name: "MenuManagement",
  data() {
    return {
      headerData: [
        {
          prop: "name",
          label: "名称",
          width: "180"
        },
        {
          prop: "code",
          label: "编码",
          width: "180"
        },
        {
          prop: "icon",
          label: "图标",
          width: "180"
        },
        {
          prop: "component",
          label: "组件",
          width: "180"
        },
        {
          prop: "isMenuName",
          label: "类型",
          width: "180"
        },
        {
          prop: "url",
          label: "URL",
          width: "180"
        },
        {
          prop: "hidden",
          label: "是否隐藏",
          width: "180"
        },
        {
          prop: "num",
          label: "顺序",
          width: "180"
        },
        {
          prop: "operation",
          label: "操作",
          width: "180"
        }
      ],
      tableData: []
    };
  },
  mounted() {
    let _self = this;
    _self.MenuManagementInterfaceFn();
  },
  methods: {
    async MenuManagementInterfaceFn() {
      let _self = this;
      _self.tableData = [];
      let data = {
        name: _self.input
      };
      await MenuManagementInterface(data).then(res => {
        let _self = this;
        console.log(res);
        if ((res.code = 20000)) {
          for (let item of res.data) {
            _self.tableData.push({
              name: item.name,
              code: item.code,
              icon: item.icon,
              component: item.component,
              isMenuName: item.isMenuName,
              url: item.url,
              hidden: item.hidden,
              num: item.num,
              operation: item.operation
            });
          }
        }
      });
    }
  },
  components: {
    supertable  
  }
};
</script>
<style>

</style>
